﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MINERP.COM;

namespace MINERP.MODEL.FoundationModel
{
    public class NewPerformanceInfo
    {
        public int OrderProductId { get; set; }
        public int TechId { get; set; }
        public string TechName { get; set; }
        public String ShopName { get; set; }
        public string CtmName { get; set; }
        public string OrderProductName { get; set; }
        public DateTime OrderCreateTime { get; set; }//开单时间
        public DateTime ReceivedTime { get; set; }//接收时间
        public DateTime TechCompletedTime { get; set; }//提交时间
        public DateTime OrderCompletedTime { get; set; }//产品完成时间
        public string UserName { get; set; }//提交人
        public int Status { get; set; }//与ORDERINFO的状态一样     
        public int PhotoTotalNum { get; set; }//产品的照片总张数
        public int SinglePageNum { get; set; }//单页数
        public int MultiplePageNum { get; set; }//跨页数
        public string OrderPath { get; set; }//产品路径
        public double PreOrderArea { get; set; }//开单时预估的产品面积
        public double OrderArea { get; set; }//实际收款的面积
        public decimal OrderCount { get; set; }//此产品实收总价
        public int ProductPhotoNum { get; set; }//此产品中的总的照片数量
        public string ProductName
        {
            get
            {
                if (!string.IsNullOrEmpty(OrderProductName))
                {
                    return OrderProductName.Substring(OrderProductName.LastIndexOf('_') + 1);
                }
                else
                {
                    return string.Empty;
                }
            }
        }//等于orderProductName取最后一个"_"后面的字符串

        public string StatusName
        {
            get
            {
                switch ((OrderInfoStatus)Status)
                {
                    case OrderInfoStatus.Doing:
                        return "正在生产";
                        break;
                    case OrderInfoStatus.Stop:
                        return "被暂停";
                        break;
                    case OrderInfoStatus.Completed:
                        return "已完成";
                        break;
                    case OrderInfoStatus.Deleted:
                        return "被删除";
                        break;
                    default:
                        return "请从客服查询状态";
                        break;
                }
            }
        }
    }
}
